package com.tools.commons.constants;

import lombok.Getter;

public class SystemConstants {
    public static final String TOKEN = "token";
    public static final String EMPTY_STRING = "";
    public static final String WX_SUBSCRIBE_NOTICE = "rand";
    public static final String REQUEST_ID = "requestId";
    public static final String X_FORWARDED_FOR = "X-Forwarded-For";

    public interface EventKey {
        String SUBSCRIBE_NOTICE = "qrscene_" + WX_SUBSCRIBE_NOTICE;
    }

    public interface MQ {
        String USER_SUBSCRIBE_NOTICE = "mq_user_subscribe_notice";
        String SEND_NOTICE = "mq_send_notice";
    }

    public interface Api {
        String Base = "/api/v1";
        String Auth = Base + "/auth";
        String USERS = Base + "/users";
        String USER = Base + "/user";
        String LOG = Base + "/log";
        String CODE = Base + "/code";
        String DOCTOR = Base + "/doctor";
        String CAPTCHA = Base + "/captcha";
        String PICS = Base + "/pics";
    }

    public interface SPLIT {
        String split = "\\|";
        String split_append = "|";
    }

    public interface Header {
        String CONTENT_TYPE = "Content-type";
        String UTF_8 = "UTF-8";
        String CONTENT_TYPE_JSON = "application/json";
        String CONTENT_TYPE_FORM_URLENCODED = "application/x-www-form-urlencoded";
        String CONTENT_TYPE_MULTIPART = "multipart/form-data";
        String CONTENT_TYPE_XML = "application/xml";
        String CONTENT_TYPE_TEXT_PLAIN = "text/plain";
        String CONTENT_TYPE_TEXT_XML = "text/xml";
        String CONTENT_TYPE_TEXT_HTML = "text/html";
    }

    public enum Oauth {
        GIT_EE("gitee"),
        GITHUB("github"),
        UNKNOWN("unknow");

        Oauth(String type) {
            this.type = type;
        }

        @Getter
        private final String type;

        public static Oauth find(String type) {
            for (Oauth value : values()) {
                if (value.type.equals(type))
                    return value;
            }
            return UNKNOWN;
        }
    }
}
